package com.cl.short_video_java.web.client.ad;

import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.pojo.VideoAd;
import com.cl.short_video_java.service.VideoAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author 付
 * @Date 2024-11-27 11:55
 * @Version 1.0
 * @description 前台广告类型
 * @since 1.0
 */
@RestController
@RequestMapping("/client/ad")
public class ClientAdController {

	@Autowired
	private VideoAdService adService;

	/**
	 * 获取分类的相关广告
	 *
	 * @return
	 */
	@GetMapping("/type-ad")
	public Result typeAd() {
		Map<String, List<VideoAd>> map = adService.typeAd();
		return Result.success(map);
	}

	@GetMapping("/home-ad")
	public Result homeAd() {
		Map<String, List<VideoAd>> map = adService.homeAd();
		return Result.success(map);
	}


}
